package aidl;

import android.os.Parcel;
import android.os.Parcelable;

public class Book implements Parcelable{

	private int price;
	private String name;
	
	public Book() {
	}

	public Book(Parcel parcel){
		name = parcel.readString();
		price = parcel.readInt();
	}
	
	public String getname(){
		return name;
	}
	public void setname(String bookname){
		this.name = bookname;
	}
	public int getprice(){
		return price;
	}
	public void setprice(int bookprice){
		this.price = bookprice;
	}
	
	
	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel parcel, int flags) {
		parcel.writeString(name);
		parcel.writeInt(price);
	}
	
	public static final Parcelable.Creator<Book> CREATOR = new Creator<Book>() {

		@Override
		public Book createFromParcel(Parcel source) {
			return new Book(source);
		}

		@Override
		public Book[] newArray(int size) {
			return new Book[size];
		}
	};

}
